cd "/Users/gaborsimonovits/Dropbox/populism/jop/final_replication_material"
*** Read in analysis data


use erosion.dta


***  Table OA1: Summary statistics and balance on demographics

** Full sample

sum exact_age female white college republican_party independent democrat_party pid_intensity

sum exact_age female white college republican_party independent democrat_party pid_intensity if erosion_condition=="control"

sum exact_age female white college republican_party independent democrat_party pid_intensity if erosion_condition=="congruent" & threat_prime=="no"
sum exact_age female white college republican_party independent democrat_party pid_intensity if erosion_condition=="congruent" & threat_prime=="yes"

sum exact_age female white college republican_party independent democrat_party pid_intensity if erosion_condition=="incongruent" & threat_prime=="no"
sum exact_age female white college republican_party independent democrat_party pid_intensity if erosion_condition=="incongruent" & threat_prime=="yes"


**** Table OA2: Regression estimates for Figure 2


reg erosion inparty pid_intensity democracy if threatened==0, r
reg erosion inparty pid_intensity democracy if threatened==1, r

reg erosion inparty threatened inparty_threatened pid_intensity democracy, r


*** Table OA4: Experimental results by party

*** Indepentents forced to choose parties
   

reg erosion inparty threatened inparty_threatened pid_intensity democracy if respondent_party=="Republican" , r
outreg2 using erosion_party.xls, bdec(1) sdec(1) br  

reg erosion inparty threatened inparty_threatened pid_intensity democracy if respondent_party=="Democrat" , r
outreg2 using erosion_party.xls, bdec(1) sdec(1) br  append

*** Indepentents analyzed separately


reg erosion inparty threatened inparty_threatened pid_intensity democracy if republican_party==1 , r
outreg2 using erosion_party.xls, bdec(1) sdec(1) br  append

reg erosion inparty threatened inparty_threatened pid_intensity democracy if independent==1 , r
outreg2 using erosion_party.xls, bdec(1) sdec(1) br  append

reg erosion inparty threatened inparty_threatened pid_intensity democracy if democrat_party==1 , r
outreg2 using erosion_party.xls, bdec(1) sdec(1) br  append



** Table OA5: Treatment e↵ects compared to baseline condition

gen erosion_ct= erosion_c
replace erosion_ct= erosion if erosion_c==.

reg erosion_ct inparty outparty pid_intensity democracy if threatened!=1 ,r
outreg2 using erosion_tc.xls, bdec(1) sdec(1) br  

reg erosion_ct inparty outparty pid_intensity democracy if threatened!=1 & respondent_party=="Republican" , r
outreg2 using erosion_tc.xls, bdec(1) sdec(1) br  append

reg erosion_ct inparty outparty pid_intensity democracy if threatened!=1 & respondent_party=="Democrat", r
outreg2 using erosion_tc.xls, bdec(1) sdec(1) br  append




** Table OA6: In-party governor and support for norm-erosion

reg erosion_c_gov gov_cong  democracy pid_intensity if republican_party==1, cl(state)
outreg2 using erosion_gov.xls, bdec(1) sdec(1) br  

reg erosion_c_gov gov_cong  democracy pid_intensity if democrat_party==1, cl(state)
outreg2 using erosion_gov.xls, bdec(1) sdec(1) br  append

reg erosion_c_gov gov_cong  democracy pid_intensity republican_party if independent==0 , cl(state)
outreg2 using erosion_gov.xls, bdec(1) sdec(1) br  append
